import { createI18n } from 'vue-i18n';
import zhCNLocale from './lang/zh.ts';
import enLocale from './lang/en.ts';
// import { useAppStore } from "@/stores/app";
// import { storeToRefs } from "pinia";

// const store = useAppStore()
// const { language }= storeToRefs(store)

const message = {
  en: {
    ...enLocale,
  },
  zh: {
    ...zhCNLocale,
  },
};

const i18n = createI18n({
  // 使用composition API
  legacy: false,
  // 全局使用t函数
  globalInjection: true,
  // 关闭控制台警告
  silentFallbackWarn: true,
  locale: 'zh',
  messages: message,
});
export default i18n;